package org.example.promotion;

public class ThresholdDiscountPromotion implements PromotionRule {
    private final double threshold;
    private final double discount;
    
    public ThresholdDiscountPromotion(double threshold, double discount) {
        this.threshold = threshold;
        this.discount = discount;
    }
    
    public double getThreshold() {
        return threshold;
    }
    
    public double getDiscount() {
        return discount;
    }
    
    @Override
    public double applyPromotion(double total) {
        if (total >= threshold) {
            return total - discount;
        }
        return total;
    }
}
